home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / as5.zip / ASEMBLER.DOC < prev    next >
Text File  |  1987-12-09  |  9KB  |  261 lines

  1.  
  2.  
  3.           The IBM PC 6800/01/04/05/09/11 cross assemblers
  4.  
  5.  
  6. GENERAL
  7.     The assemblers are named as*.exe where '*' is  any
  8.     of 0,1,h1,4,5,9 or 11 depending on which one you're using.  Command
  9.     line arguments specify the filenames to assemble.
  10.  
  11.     The assemblers accept options from the command line to be
  12.     included in the assembly.  These options are the following:
  13.  
  14.         l       enable output listing.
  15.         nol    disable output listing (default).
  16.         cre    generate cross reference table.
  17.         s       generate a symbol table.
  18.         c       enable cycle count.
  19.         noc    disable cycle count.
  20.  
  21.     The command line looks like this :
  22.  
  23.            as* file1 file2 ... [ - option1 option2 ...]
  24.  
  25.     If this method of passing commands to the assembler is
  26.     used rather than the OPT pseudo op code, a space should
  27.     separate the minus sign from the last file name and the
  28.     first option.  Example:
  29.  
  30.        as5 program -l cre
  31.  
  32.     This command assembles file 'program' with an output
  33.     listing and a cross reference table.
  34.  
  35.     The `S1' formatted object file is placed in file
  36.     `filename.S19', the listing and error messages are
  37.     written to  the standard output.  If multiple files are
  38.     assembled, the 'S1' file will be placed under the first
  39.     file's name.S19.
  40.  
  41.     The listing file contains the address and bytes assembled for each
  42.     line of input followed by the original input line (unchanged, but
  43.     moved over to the right some).    If an input line causes more than 6
  44.     bytes to be output (e.g. a long FCC directive), additional bytes
  45.     (up to 64) are listed on succeding lines with no address preceding
  46.     them.
  47.  
  48.     Equates cause the value of the expression to replace the address
  49.     field in the listing.
  50.  
  51.     Equates that have forward references cause Phasing Errors in Pass
  52.     2.
  53.  
  54.     Expressions may consist of symbols, constants or the character    '*'
  55.     (denoting the current value of the program counter) joined together
  56.     by one of the operators: +-*/%&|^.  The operators are the same as
  57.     in C:
  58.  
  59.         +    add
  60.         -    subtract
  61.         *    multiply
  62.         /    divide
  63.         %    remainder after division
  64.         &    bitwise and
  65.         |    bitwise or
  66.         ^    bitwise exclusive-or
  67.  
  68.     Expressions are evaluated left to right and there is no provision
  69.     for parenthesized expressions.    Arithmetic is carried out in signed
  70.     twos-complement integer precision (16 bits on the IBM PC)
  71.  
  72.     Constants are constructed with the same syntax as the Motorola MDOS
  73.     assembler:
  74.  
  75.         '       followed by ASCII character
  76.         $    followed by hexadecimal constant
  77.         @    followed by octal constant
  78.         %    followed by binary constant
  79.         digit    decimal constant
  80.  
  81. ERRORS
  82.  
  83.     Error diagnostics are placed in the listing file just before the
  84.     line containing the error.  Format of the error line is:
  85.  
  86.         Line_number: Description of error
  87.             or
  88.         Line_number: Warning --- Description of error
  89.  
  90.     Errors of the first type in pass one  cause  cancellation  of  pass
  91.     two.  Warnings    do  not  cause    cancellation of pass two but should
  92.     cause you to wonder where they came from.
  93.  
  94.     Error messages are meant to be self-explanatory.
  95.  
  96.     If more than one file is being assembled, the  file  name  precedes
  97.     the error:
  98.  
  99.         File_name,Line_number: Description of error
  100.  
  101.     Finally, some errors are classed as fatal and  cause  an  immediate
  102.     termination  of  the assembly.    Generally these errors occur when a
  103.     temporary file cannot be created or is lost  during  the  assembly.
  104.     Consult your local guru if this happens.
  105.  
  106.  
  107. DIFFERENCES
  108.  
  109.     For indexed addressing, the comma is required before the  register;
  110.     `inc x' and `inc ,x' are not the same.
  111.  
  112.         Macros are not supported.  (try M4 or M6)
  113.  
  114.     The force size operators ('>' and  '<')  are  implemented  for  all
  115.     assemblers.
  116.  
  117.         The only pseudo-ops supported are:
  118.  
  119.             ORG, FCC, FDB, FCB, EQU, RMB, BSZ, ZMB, FILL
  120.             PAGE and OPT.
  121.  
  122.         The OPT pseudo-op allows the following operands:
  123.  
  124.             nol    Turn off output listing
  125.             l    Turn on output listing (default)
  126.             noc    Disable cycle counts in listing (default)
  127.             c    Enable cycle counts in listing (clear total cycles)
  128.             contc    Re-enable cycle counts (don't clear total cycles)
  129.             cre    Enable printing of a cross reference table
  130.             s    generate a symbol table
  131.  
  132.         Some of the more common pseudo-ops are not present:
  133.  
  134.             SPC    Use blank lines instead
  135.             END    The assembly ends when there is no more input
  136.             TTL    use `pr' to get headings and page numbers
  137.             NAM[E]    Did you ever use this one anyway?
  138.  
  139.         The above 4 pseudo-ops are recognized, but ignored.
  140.  
  141.         ZMB (Zero Memory Bytes) is equivalent to BSZ (Block Store  Zeroes).
  142.         FILL can be used to initialize memory to something other than zero:
  143.         FILL val,nbytes.
  144.  
  145. TARGET MACHINE SPECIFICS
  146.  
  147.  (as0)    6800:    Use for 6802 and 6808 too.
  148.  
  149.  (as1)    6801:    You could use this one for  the  6800  and  avoid
  150.         LSRD, ASLD, PULX, ABX, PSHX, MUL, SUBD, ADDD, LDD
  151.         and STD.
  152.  
  153.  (as4)    6804:    The symbols 'a', 'x' and 'y'  are  predefined  as
  154.         $FF, $80 and $81 respectively.    Also  defined  as
  155.         'A',   'X'   and   'Y'.    Because  of  the  6804
  156.         architecture, this means that 'clr x'  will  work
  157.         since  the  x register is just a memory location.
  158.         To  use  short-direct  addressing,   the   symbol
  159.         involved  must    not  be a forward reference (i.e.
  160.         undefined) and must be in the range $80-$83.
  161.  
  162.         Remember  that    bytes  assembled  in  the   range
  163.         $10-$7F  will go into the data space; There is no
  164.         program space ROM for these locations.
  165.  
  166.         The syntax for Register indirect addressing is as
  167.         follows:
  168.               menmonic [<x>or<y>]
  169.         an example is:
  170.                 lda [x]
  171.         the comma ',' is not allowed.
  172.  
  173.         The MVI instruction (move immediate) has its own
  174.         format :
  175.  
  176.              mvi address,#data   where address is
  177.            an 8-bit address in page zero, and data is
  178.            the value to be written to specified location.
  179.  
  180.  (as5)    6805:    There is no 'opt cmos' pseudo, so be careful  not
  181.         to use STOP or WAIT in a program that is destined
  182.         for  an  NMOS  version    of  the  6805.     The  MUL
  183.         instruction   should   also  be  avoided  on  all
  184.         versions of the 6805 except the C4.  Cycle  times
  185.         are for the NMOS versions.
  186.  
  187.  (as9)    6809:    The SETDP pseudo-op is not implemented.
  188.         Use the '>' and '<` operators to force the size of
  189.         operands.
  190.  
  191.             For compatibility, CPX is equal to CMPX.
  192.  
  193.  (as11) 68HC11: Bit manipulation operands are separated by  blanks  instead
  194.         of commas since the 'HC11 has bit manipulation instructions
  195.         that operate on indexed addresses.
  196.  
  197.  
  198.  
  199.  
  200.  
  201. DETAILS
  202.     Symbol:  A string of  characters  with    a  non-initial    digit.    The
  203.         string of characters may be from the set:
  204.  
  205.                [a-z][A-Z]_.[0-9]$
  206.  
  207.         ( . and _ count as non-digits ).  The `$' counts as a digit
  208.         to   avoid   confusion    with  hexadecimal  constants.    All
  209.         characters of a symbol    are  significant,  with  upper    and
  210.         lower  case  characters being distinct.  The maximum number
  211.         of characters in a symbol is currently set at 15.
  212.  
  213.         The symbol table has room for  at  least  2000    symbols  of
  214.         length 8 characters or less.
  215.  
  216.     Label:    A symbol starting in the first column is a  label  and    may
  217.         optionally  be    ended  with a ':'.  A label may appear on a
  218.         line by itself and is then interpreted as:
  219.  
  220.             Label    EQU    *
  221.  
  222.     Mnemonic:  A symbol preceded by at least one whitespace  character.
  223.         Upper  case characters in this field are converted to lower
  224.         case before being checked as a legal mnemonic.    Thus `nop',
  225.         `NOP' and even `NoP' are recognized as the same mnemonic.
  226.  
  227.         Note that register names that sometimes appear at  the    end
  228.         of  a  mnemonic (e.g. nega or stu) must not be separated by
  229.         any  whitespace  characters.   Thus  `clra'   means   clear
  230.         accumulator A, but that `clr a' means clear memory location
  231.         `a'.
  232.  
  233.     Operand:  Follows mnemonic, separated by at  least  one  whitespace
  234.         character.   The   contents   of   the     operand  field  is
  235.         interpreted by each instruction.
  236.  
  237.     Whitespace: A blank or a tab
  238.  
  239.     Comment:  Any text after all operands for  a  given  mnemonic  have
  240.         been  processed or, a line beginning with '*' up to the end
  241.         of line or, an empty line.
  242.  
  243.     Continuations:    If a line ends with a backslash (\) then  the  next
  244.         line  is